import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    user: {
      name: '',
      head: '',
      token: ''
    },
    tableData: [{
      date: '2016-05-02',
      name: '王小虎',
      number: 1,
      address: '上海市普陀区金沙江路 1518 弄',
      state: 1,
      id:'11',
    }, {
      date: '2016-05-04',
      name: '王小虎',
      number: 1,
      address: '上海市普陀区金沙江路 1517 弄',
      state: 2,
      id:'22',
    }, {
      date: '2016-05-01',
      name: '王小虎',
      number: 3,
      address: '上海市普陀区金沙江路 1519 弄',
      state: 3,
      id:'33',
    }, {
      date: '2016-05-03',
      name: '王小虎',
      number: 1,
      address: '上海市普陀区金沙江路 1516 弄',
      state: 2,
      id:'44',
    }]
  },
  mutations: {
    setUser(state, value) {
      state.user = value
    },
    setTable(state, value) {
      console.log(value);
      state.tableData = value
    }
  },
  actions: {
  },
  modules: {
  }
})
